//
//  NFSRadioCollectionViewCell.m
//  NeedForSpeed
//
//  Created by 王国强 on 15/10/19.
//  Copyright © 2015年 Avenger. All rights reserved.
//

#import "NFSRadioCollectionViewCell.h"

#import "BaseHeader.h"
@implementation NFSRadioCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.album_imgurlView = [[UIImageView alloc]initWithFrame:CGRectMake(frame.size.width/8, frame.size.height/ 5, frame.size.width * 3 / 4, frame.size.height * 3 / 5)];
        [self.album_imgurlView.layer setCornerRadius:frame.size.width *3 /8];
        [self.album_imgurlView.layer setBorderColor:[UIColor whiteColor].CGColor];
        [self.album_imgurlView.layer setBorderWidth:1.];
        self.album_imgurlView.layer.masksToBounds =YES;
        self.album_imgurlView.userInteractionEnabled = YES;
        [self.contentView addSubview:self.album_imgurlView];
        
        self.album_nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width /8, frame.size.height * 4 / 5, frame.size.width * 3 / 4, frame.size.height / 10)];
        [self.album_nameLabel setFont:[UIFont systemFontOfSize:14.]];
        self.album_nameLabel.textAlignment = NSTextAlignmentCenter;
         [self.contentView addSubview: self.album_nameLabel];
        
        self.update_timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width / 8, frame.size.height * 9 / 10, frame.size.width * 3/ 4, frame.size.height / 10)];
        [self.update_timeLabel setFont:[UIFont systemFontOfSize:10.]];
        [self.update_timeLabel setTextColor:[UIColor grayColor]];
        [self.contentView addSubview:self.update_timeLabel];
        
        
    }
    return self;
}
- (void)getdata:(NFSRadioModel *)model
{
    NSURL *url  = [NSURL URLWithString:model.album_bigImgurl];
    [self.album_imgurlView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"hoder.jpg"]];
    [self.album_nameLabel setText:model.album_name];
    [self.update_timeLabel setText:model.update_time];
}
@end
